//
//  HeaderView.m
//  ForengnMenu
//
//  Created by wenzhaoxu on 16/1/22.
//  Copyright © 2016年 余旺. All rights reserved.
//

#import "HeaderView.h"

@implementation HeaderView


- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    
    if (self) {
        
    }
    return self;
}


- (void)awakeFromNib{
    self.myView = [UIView new];
    CGFloat height = 2;
    
    self.myView.frame = CGRectMake(0, self.bounds.size.height - height, self.bounds.size.width/4.0f, height);
    self.myView.backgroundColor = [UIColor redColor];
    [self addSubview:self.myView];
    
    //轻敲手势
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(headImageViewAction)];
    
    //设置手指数量
    tap.numberOfTouchesRequired = 1;
    
    //设置触摸次数
    tap.numberOfTapsRequired = 1;
    
    self.headImageView.userInteractionEnabled = YES;
    
    //添加到ImageView上去
    [self.headImageView addGestureRecognizer:tap];
    
}
//赞
- (IBAction)praiseAction:(id)sender {
    
    [self.delegate praiseAction];
    
}

-(void)headImageViewAction{

    [self.delegate headImageViewAction];

}

- (IBAction)practiceAction:(id)sender {
    
    [self.delegate selectAction:0];

}

- (IBAction)ingredientsAction:(id)sender {
    
    [self.delegate selectAction:1];
}

- (IBAction)tipsAction:(id)sender {
    
    [self.delegate selectAction:2];

}
- (IBAction)xiaoTiesAction:(id)sender {
    
    [self.delegate selectAction:3];

}
@end
